<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('管理')"/>
    <style>
        span.xrequired:before {
            content: '*';
            color: red;
        }
    </style>
</head>
<body>
<div class="wrapper">
    <form style="font-size: 12px" id="form" th:object="${carGoods}">
        <div class="box-body">
            <!--            <input type="hidden" th:field="*{id}">-->
            <div class="form-group">
                <label>编号(需与车机协定)</label><span class="xrequired"></span>
                <input type="text" class="form-control input-sm" placeholder="车机商城商品协议编号" required th:field="*{id}">
            </div>
            <div class="form-group">
                <label>名称</label><span class="xrequired"></span>
                <input type="text" class="form-control input-sm" th:field="*{name}">
            </div>
            <div class="form-group">
                <label>类型</label><span class="xrequired"></span>
                <select type="text" class="form-control input-sm" th:field="*{type}">
                    <option value="0">ADAS</option>
                    <option value="1">RMON</option>
                </select>
            </div>
            <div class="form-group">
                <label>价格</label><span class="xrequired"></span>
                <input type="text" class="form-control input-sm" th:field="*{price}">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = "/car/goods";
    $(function () {
    });

    function submitHandler() {
        if ($.validate.form()) {
            var json = $.common.formToJSON('form');
            $.operate.save(prefix + '/save', json);
        }
    }
</script>
</body>
</html>
